---
id: 65578c17d54dfab65cd54b95
title: Step 31
challengeType: 20
dashedName: step-31
---

# --description--

Since the algorithm begins its assessment from the starting node, after creating the `paths` dictionary, you need to add the starting node to its own list in the `paths` dictionary.

Use the `append()` method to append `start` to the `paths[start]` list.


# --hints--

You should use the `append()` method to append `start` to `paths[start]`.

```js
({ test: () =>  {
    const shortest = __helpers.python.getDef(code, "shortest_path");
    const {function_body} = shortest;
    assert(function_body.match(/^\s{4}paths\s*\[\s*start\s*\]\s*\.append\s*\(\s*start\s*\)/m));
  }
})
```

# --seed--

## --seed-contents--

```py
my_graph = {
    'A': [('B', 3), ('D', 1)],
    'B': [('A', 3), ('C', 4)],
    'C': [('B', 4), ('D', 7)],
    'D': [('A', 1), ('C', 7)]
}
--fcc-editable-region--
def shortest_path(graph, start):
    unvisited = list(graph)
    distances = {node: 0 if node == start else float('inf') for node in graph}
    paths = {node: [] for node in graph}
    
    print(f'Unvisited: {unvisited}\nDistances: {distances}')
    
shortest_path(my_graph, 'A')
--fcc-editable-region--
```
